<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link href="/vendor/b/3.3.5/css/bootstrap.min.css" rel="stylesheet">
		<link href="/plugs/ticket/lib/dist/summernote.css" rel="stylesheet">
		<script src="/vendor/jquery/1.11.3/jquery.min.js"></script>
		<script src="/vendor/b/3.3.5/js/bootstrap.min.js"></script>
		<script src="/plugs/ticket/lib/dist/summernote.min.js"></script>
		<script src="/vendor/base64.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.row{
				padding: 5px;
			}
			.row .col-md-12{
				padding-bottom: 10px;
				border-bottom: 1px dotted #CFCFCF;
			}
			.ticketContent{
				padding-bottom: 20px;
				margin-bottom: 10px;
			}
			.btn{
				border-radius: 0px;
			}
		</style>
	</head>

	<body>
		<div class="row">
			<div class="col-md-12">
				<h4><%= SUBJECT %></h4>
				<em><%= CREATE_TIME %></em>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<button type="button" class="btn btn-primary">
					<%  if(STATUS==0){ %>
						等待处理
					<%}else if(STATUS==1){%>
						正在处理
					<%}else if(STATUS==2){%>
						持续跟进
					<%}else if(STATUS==3){%>
						工单驳回
					<%}else if(STATUS==4){%>
						处理完毕
					<%}%>
				</button>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<button class="btn"><%= CUSTOMER %></button>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div class="ticketContent" style="border-bottom: 5px solid #CFCFCF;width: 100%;">
					<%= CONTENT %>
				</div>
				<em>请在下面输入框回复消息、或者按照工单内容开始工单任务(当前版本只支持回复到客户邮箱、并且不接收回复)</em>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div id="summernote"></div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<button type="button" id="reply" class="btn btn-primary">回复</button>
			</div>
		</div>
		<script type="text/javascript">
			$(document).ready(function() {
			  $('#summernote').summernote({
			  	height:180
			  });
			  $("#reply").on("click",function(){
			  	var a=$('#summernote').summernote('code');
			  	var data={
			  		to:"billwongk@vip.qq.com",
			  		subject:"测试",
			  		html:Base64.encode(a)
			  	}
				$.ajax({
					type: "post",
					url: "/ticket/mail/reply/aa/aa",
					data: JSON.stringify(data),
					contentType: "application/json;charset=utf-8",
					success: function(res) {
						if(res!=-1){
							var h = top.hh.create({
								timeout: 2000,
								clickToClose: false,
								addnCls: "humane-flatty-success"
							})
							h.log("操作成功");
						}
					},
					error: function() {
						alert(0)
					}
				})
		
			  })
			});
		</script>
	</body>
</html>